package com.example.demo.service.impl;

import com.example.demo.entity.Student;
import com.example.demo.mapper.StudentMapper;
import com.example.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public Student selectStudent(int sId) {
        Student student = studentMapper.selectStudent(sId);
        return student;
    }

    @Override
    public List<Student> selectStudentById() {
        List<Student> list = studentMapper.selectStudentById();
        return list;
    }

    @Override
    public boolean deleteStduent(int sId) {
        boolean b = studentMapper.deleteStudent(sId);
        return b;


    }

    @Override
    public boolean updateStudent(int sId,String sName) {
        boolean b = studentMapper.updateStudent(sId,sName);
        return  b;
    }

    @Override
    public boolean insertStudent(int sId, String sName) {
        boolean b = studentMapper.insertStudent(sId, sName);
        return b;
    }
}
